﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BITest
{

    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
        }

        private void mainPanelToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            DataTable tbl = new DataTable();
            Exception err = new Ko2.DB.BI.KPI.MainPanel().Get(ref tbl);
            gv.DataSource = tbl;
        }

        private void top10ShopsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable tbl = new DataTable();
            Exception err = new Ko2.DB.BI.KPI.Top10Shops().Get(ref tbl);
            DataView view = tbl.DefaultView;
            view.Sort = "Turnover DESC";
            gv.DataSource = tbl;
        }

        private void cashAtYearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable tbl = new DataTable();
            Exception err = new Ko2.DB.BI.KPI.CashAtYear().Get(ref tbl);
            gv.DataSource = tbl;
        }

        private void shopsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable tbl = new DataTable();
            Exception err = new Ko2.DB.BI.Catalogs.Shops().Get(ref tbl);
            gv.DataSource = tbl;
        }

        private void bIShopsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable tbl = new DataTable();
            Exception err = new Ko2.DB.BI.Catalogs.Shops().Get(ref tbl, 2012, 1, 13);
            //Exception err = new Ko2.DB.BI.Catalogs.Shops().GetFromWS(ref tbl);
            gv.DataSource = tbl;
        }

        private void cashToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable tbl = new DataTable();
            Exception err = new Ko2.DB.BI.Reports.Cash().Get(ref tbl);
            gv.DataSource = tbl;
        }

        private void cashCabeCheckToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable tbl = new DataTable();
            Exception err = new Ko2.DB.BI.Reports.Cash().GetCubeCheck(ref tbl);
            gv.DataSource = tbl;
        }

        private void cashCubeCheckByDayToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable tbl = new DataTable();
            DateTime dt = DateTime.Now;
            dt = dt.AddDays(-5);
            Exception err = new Ko2.DB.BI.Reports.Cash().GetCubeCheckByDay(ref tbl, dt);
            gv.DataSource = tbl;
        }

        private void cashCabeTradeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataTable tbl = new DataTable();
            Exception err = new Ko2.DB.BI.Reports.Cash().GetCubeTrade(ref tbl);
            gv.DataSource = tbl;
        }



    }

}
